package com.liukai.todo_android.broadcastReceiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.liukai.todo_android.common.utils.LogUtils;

public class CountDownBroadcastReceiver extends BroadcastReceiver {

    public static final String stopTime = "00:00:00";

    @Override
    public void onReceive(Context context, Intent intent) {
        Bundle bundle = intent.getExtras();
        String time = bundle.getString("time");
        boolean isStop = false;
        if (time.equals(stopTime)) {
            isStop = true;
        }
        LogUtils.e(getClass(), time + " <==========>CountDownBroadcastReceiver1111");
        updateCountListener.updateCountDown(time, isStop);
    }

    public interface UpdateCountListener {
        void updateCountDown(String newSting, boolean isStop);
    }

    private UpdateCountListener updateCountListener;

    public void setUpdateCountListener(UpdateCountListener updateCountListener) {
        this.updateCountListener = updateCountListener;
    }
}